/**
 * 功能描述
 */

define(function (require, exports, module) {
	var Component = require("grid");
	var proctrgrid = require("../constant/fetchProperties");
    var instance = {
        initComponent: function (params, widget) {
            var grid = new Component({
            	parentNode : ".J-grid",	
            	url : "api/welfareconsumptioncoupon/queryall",
//            	autoRender : false,
				params : function(){
					var subnav = widget.get("subnav");
					var obj = {
							"operateDate":subnav.getValue("operateDate").start,
							"operateDateEnd":subnav.getValue("operateDate").end,
							"flag":true,
                			fetchProperties : proctrgrid.fetchProperties
                	};
	    			return obj;
				},
				model : {
				 columns  : [{
					 name : "welfareConsumptionCoupon.cardNo",
					 label : "卡号",
				 },{
					 name : "welfareConsumptionCoupon.travelContract.member.personalInfo.name",
					 label : "会员",
				 },{
					 name : "operateDate",
					 label : "时间",
					 format:"date",
					 formatparams:{
							mode:"YYYY-MM-DD HH:mm"
					}
				 },{
					 name : "price",
					 label : "取现金额(元)",
				 },{
					 name : "welfareConsumptionCoupon.balance",
					 label : "卡余额(元)",
				 },{
					 name : "operator.name",
					 label : "操作人员",
				 }]
				}
            });
            widget.set("grid", grid);
        }
    };
    module.exports = instance;
});
